#pragma once

#include "Property.h"

class CFunctionProperty;

class CFunctionPropertyGetSet: public INonStaticProperty
{

public:
    CFunctionPropertyGetSet(CFunctionProperty* InProperty);

	virtual CAny GetValue(const void * InObjectPtr) override ;
	virtual void SetValue(void * InObjectPtr,const CAny& InValue) override ; 

protected:
    CFunctionProperty* Property;
};




//a property that is a setter and getter function
class WHENGINE_API CFunctionProperty: public CProperty
{
public:	
	CFunctionProperty(
		CPropertyList* InParentList
		, TMap<EPropertyFlags,  SReflectionMetaDataValue> InMetaData
		, std::function<CAny(const void* /*object ptr*/) > InGetterFunction            //must be bound 
		, std::function<void(void* /*object ptr*/,const CAny& )> InSetterFunction//must be bound 
		, const SDecoratedType& InType
        , CString InName
		);

protected:
	std::function<CAny(const void* /*object ptr*/ )> GetterFunction;
		
	std::function<void(void* /*object ptr*/,const CAny& )> SetterFunction;		


    friend class CFunctionPropertyGetSet;
};